Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIO-8724: Fixed firing change event for DataGrid component #5933

Merged

Conversation

roma-formio
Copy link
Contributor

@roma-formio roma-formio commented Dec 3, 2024

Link to Jira Ticket

https://formio.atlassian.net/browse/FIO-8724

Description

Original issue
Issue: Any change to the data grid (e.g., adding or removing a row) or any change to a nested component within the data grid should trigger a data grid change event and refresh the select component based on the refresh on data grid configuration. Change events are only fired for the nested component itself, not for the entire data grid.

Solution: The Edit Grid component fires change events when a row is saved or removed. However, the Data Grid should be treated as a special case of the Edit Grid, where any change to a nested component triggers a row save. Therefore, we need to track change events in the data grid and fire an additional event for the entire data grid component. This will ensure that the select component can refer to the data grid for refreshing.

Failing test case: Should trigger the correct conditional when a nested form uses the same key as a parent form.
Issue: Previously, to check nested form conditions, we used subform data. However, with recent path changes, the logic was modified to pass the entire form data to the nested form conditions check. As a result, conditions for the nested form are checking data for the entire form instead of only the nested form data. Additionally, the test case isn't consistently detectable because the webform and nested form call the triggerChange method independently, causing a race condition during the conditions check. Increasing the timeout leads to 100% reproduction of the failing test case.

Solution: Pass only the nested form data to the condition check process.

How has this PR been tested?

Unit testing

Checklist:

  • I have completed the above PR template
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • My changes include tests that prove my fix is effective (or that my feature works as intended)
  • New and existing unit/integration tests pass locally with my changes
  • Any dependent changes have corresponding PRs that are listed above

@johnformio johnformio merged commit 3a4aca1 into master Jan 8, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants